package com.thread;

public class ThreadRunnable implements Runnable {

	private Thread tt;
	private String threadName;

	public ThreadRunnable(String threadName) {
		super();
		this.threadName = threadName;
	}

	public void run() {
		counter();
	}

	public void counter() {
		int i = 10;
		for (; i > 0; i--) {
			System.out.println(i + "---" + Thread.currentThread().getName());
		}
	}

	public void start() {
		System.out.println("threadName--" + threadName);
		if (tt == null) {
			tt = new Thread(this, threadName);
			tt.start();
		}
	}

}
